test_runner: exclude files with no matching tests from report#64171
Open
Han5991 wants to merge 4 commits into
Open
test_runner: exclude files with no matching tests from report#64171Han5991 wants to merge 4 commits into
Han5991 wants to merge 4 commits into
Conversation
Under process isolation, a test file whose tests are all filtered out by --test-name-pattern or --test-skip-pattern was still reported as a spurious passing entry and counted in the test totals. Drop such files from the parent's report, so they are neither shown nor counted. This matches the existing --test-isolation=none behavior. Refs: nodejs#64099 Signed-off-by: sangwook <rewq5991@gmail.com>
Collaborator
|
Review requested:
|
Signed-off-by: sangwook <rewq5991@gmail.com>
Signed-off-by: sangwook <rewq5991@gmail.com>
avivkeller
reviewed
Jun 28, 2026
Comment on lines
+288
to
+295
| const noError = !this.error || this.error.failureType === kSubtestsFailed; | ||
| if (!noError) { | ||
| return false; | ||
| } | ||
| if (this.#reportedChildren > 0) { | ||
| return true; | ||
| } | ||
| return this.root.harness.isFilteringByName; |
Member
There was a problem hiding this comment.
I feel like this changes behavior, if I have a file empty.test.mjs, and it has no tests, it won't be included in the report if I'm filtering by name, but will if I'm not. IMO we should either go all the way or none of the way, not partially.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Under process isolation (the default), a test file whose tests are all filtered out by
--test-name-pattern/--test-skip-patternwas reported as a spurious passing entry (✔ file.test.js) and counted in thetests/passtotals. This drops such files from the parent's report so they are neither shown nor counted, matching what--test-isolation=nonealready does.Fixes: #64099